package com.xdtech.hotel.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import com.xdtech.core.model.BaseItem;
import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.hotel.model.DeviceEvent;
import com.xdtech.hotel.util.HotelConstants;

import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2015-05-05 22:31:28
 * @since 1.0
 * @see
 */
public class DeviceEventItem extends BaseItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="设备序列号",width=100)
	private String sn;
	@GridColumn(title="事件类型",width=100,dictionaryCode="RCU_CONTROL_TYPE")
	private String eventType;
	@GridColumn(title="事件名称",width=100)
	private String eventName;
	@GridColumn(title="事件描述",width=100)
	private String eventDesc;
	@GridColumn(title="操作人",width=100)
	private String eventOperator;
	@GridColumn(title="备注",width=100)
	private String remark;
	@GridColumn(title="操作内容",width=100)
	private String operationContent;
	@GridColumn(title="操作时间",width=150)
	private Date createTime;
	public void setId(Long id) {
		this.id = id;
		addQuerys("id", id);
	}
	public Long getId() {
		return id;
	}
	
	public void setSn(String sn) {
		this.sn = sn;
		addQuerys("sn", sn);
	}
	public String getSn() {
		return sn;
	}
	
	public void setEventType(String eventType) {
		this.eventType = eventType;
		addQuerys("eventType", eventType);
	}
	public String getEventType() {
		return eventType;
	}
	
	public void setEventName(String eventName) {
		this.eventName = eventName;
		addQuerys("eventName", eventName);
	}
	public String getEventName() {
		return eventName;
	}
	
	public void setEventDesc(String eventDesc) {
		this.eventDesc = eventDesc;
		addQuerys("eventDesc", eventDesc);
	}
	public String getEventDesc() {
		return eventDesc;
	}
	
	public void setEventOperator(String eventOperator) {
		this.eventOperator = eventOperator;
		addQuerys("eventOperator", eventOperator);
	}
	public String getEventOperator() {
		return eventOperator;
	}
	
	public void setRemark(String remark) {
		this.remark = remark;
		addQuerys("remark", remark);
	}
	public String getRemark() {
		return remark;
	}
	
	public void setOperationContent(String operationContent) {
		this.operationContent = operationContent;
		addQuerys("operationContent", operationContent);
	}
	public String getOperationContent() {
		return operationContent;
	}
	
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static DeviceEventItem createItem(DeviceEvent deviceEvent) {
		DeviceEventItem deviceEventItem = new DeviceEventItem();
		BeanUtils.copyProperties(deviceEventItem, deviceEvent);
		//自定义属性设置填充
		return deviceEventItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<DeviceEventItem> createItems(List<DeviceEvent> deviceEvents) {
		List<DeviceEventItem> deviceEventItems = new ArrayList<DeviceEventItem>();
		for (DeviceEvent deviceEvent : deviceEvents) {
			deviceEventItems.add(createItem(deviceEvent));
		}
		return deviceEventItems;
	}
}
